<style>
 .layui-form-pane .layui-form-label{
 	width:140px;
 }
 .layui-form-pane .layui-input-block{
 	margin-left:140px;
 }
</style>
<div class="layui-form-item w900">
	<label class="layui-form-label">静态资源域名</label>
	<div class="layui-input-block">
		<input type="text" name="system.static_server_domain" value="${system.static_server_domain!''}" autocomplete="off" class="layui-input" />
	</div>
</div>

<div class="layui-form-item w900">
	<label class="layui-form-label">静态服务器路径</label>
	<div class="layui-input-block">
		<input type="text" name="system.static_server_path" value="${system.static_server_path!''}" autocomplete="off" class="layui-input" />
	</div>
</div>

<div class="layui-form-item w900">
	<label class="layui-form-label">加密密钥</label>
	<div class="layui-input-block">
		<input type="text" name="system.global_auth_key" value="${system.global_auth_key!'' }" autocomplete="off" class="layui-input" onkeyup="value=value.replace(/[\u4E00-\u9FA5]/g,'')" onblur="value=value.replace(/[\u4E00-\u9FA5]/g,'')" />
	</div>
	<div class="layui-form-mid layui-word-aux">更改密钥后，会使前的加密信息无法解密，从而导致之前生成的加密信息无法解密：如找回密码、邮件验证连接等。</div>
</div>

<div class="layui-form-item w500">
	<label class="layui-form-label">后台分页数</label>
	<div class="layui-input-block">
		<input type="text" name="system.backend_pagesize" value="${system.backend_pagesize!}" autocomplete="off" class="layui-input" />
	</div>
</div>

<div class="layui-form-item w500">
	<label class="layui-form-label">虚拟目录</label>
	<div class="layui-input-block">
		<input type="text" name="system.context_path" value="${system.context_path!'' }" autocomplete="off" class="layui-input" />
	</div>
</div>



<div class="layui-form-item w500">
	<label class="layui-form-label">默认图片</label>
	<div class="layui-input-block">
		<@image src="${system.default_img_url!''}" id="img_file" style='width:100px' /><br/>
		<input type="hidden" id="default_img_url" name="system.default_img_url" value="${system.default_img_url!''}" >
		<input name="file" class="layui-upload-file" type="file" id="uploadBtn" > 
	</div>
</div>

<div class="layui-form-item w500">
	<label class="layui-form-label">wap站</label>
	<div class="layui-input-block">
		<input type="radio" name="system.wap_open"  class="wap-opation" value="1" title="开启" <#if system.wap_open?? && system.wap_open=="1">checked="checked"</#if> />
		<input type="radio" name="system.wap_open"  class="wap-opation"  value="0" title="关闭" <#if (!system.wap_open??)|| system.wap_open=="0">checked="checked"</#if> />
	</div>
</div>

<div class="layui-form-item w900">
	<label class="layui-form-label">wap站域名</label>
	<div class="layui-input-block">
		<input type="text" name="system.wap_domain" value="${system.wap_domain!'' }" autocomplete="off" class="layui-input" />
	</div>
	<div class="layui-form-mid layui-word-aux">通过此域名访问会解析下面wap模板目录的页面，使用手机访问本站点的其它域名会自动转向此域名</div>
</div>


<div class="layui-form-item w500">
	<label class="layui-form-label">wap站模板目录</label>
	<div class="layui-input-block">
		<input type="text" name="system.wap_folder" value="${system.wap_folder!'' }" autocomplete="off" class="layui-input" />
	</div>
</div>

<div class="layui-form-item w900">
	<label class="layui-form-label">手机短信支持</label>
	<div class="layui-input-block">
		<input type="radio" name="system.sms_reg_open"  value="1" title="开启" <#if system.sms_reg_open?? && system.sms_reg_open=="1">checked="checked"</#if> />
		<input type="radio" name="system.sms_reg_open"  value="0" title="关闭" <#if (!system.sms_reg_open??) ||system.sms_reg_open=="0">checked="checked"</#if> />
	</div>
	<div class="layui-form-mid layui-word-aux">开启手机短信功能后，请在"设置->短信网关设置"菜单中设置相关的参数才能正常发送短信。</div>
</div>


<div class="layui-form-item w900">
	<label class="layui-form-label">测试模式</label>
	<div class="layui-input-block">
		<input type="radio" name="system.test_mode"  value="1" title="开启" <#if system.test_mode?? && system.test_mode=="1">checked="checked"</#if> />
		<input type="radio" name="system.test_mode"  value="0" title="关闭" <#if (!system.test_mode??) ||system.test_mode=="0">checked="checked"</#if> />
	</div>
	<div class="layui-form-mid layui-word-aux">开启测试模式后 ，图片验证码和短信验证码锁定为1111</div>
</div>


<fieldset class="layui-elem-field layui-field-title">
  <legend>增值组件</legend>
</fieldset>


<div class="layui-form-item w900">
	<label class="layui-form-label">静态页生成</label>
	<div class="layui-input-block">
		<input type="radio" name="system.static_page_open"  lay-filter="check" class="check"  clz="pageCreatorComponent" value="1" title="通过静态页组件生成" <#if system.static_page_open=="1">checked="checked"</#if> />
		<input type="radio" name="system.static_page_open"   value="0" title="关闭" <#if system.static_page_open=="0">checked="checked"</#if>  />
	</div>
	<div class="layui-form-mid layui-word-aux">请确认购买并安装了静态页生成组件再启用，<a href="http://www.javamall.com.cn/component/page-creator.html" target="_blank">点击这里了解此组件的详细情况</a></div>
	<div class="layui-form-mid layui-word-aux">第一次安装静态页生成组件需要重新生成所有页面。<a href="javascript:newTab('生成静态页','${ctx}/shop/admin/page-create/input.do')">点击这里去生成所有页面。</a></div>
</div>

<div class="layui-form-item w900">
	<label class="layui-form-label">全文检索</label>
	<div class="layui-input-block">
		<input type="radio" name="system.lucene"  lay-filter="check" class="check" clz="goodsIndexComponent"   value="1" title="通过Lucene全文检索" <#if system.lucene=="1">checked="checked"</#if> />
		<input type="radio" name="system.lucene"   value="0" title="关闭" <#if system.lucene=="0">checked="checked"</#if>  />
	</div>
	<div class="layui-form-mid layui-word-aux">请确认购买并安装了商品索引组件再启用，<a href="http://www.javamall.com.cn/component/lucene.html" target="_blank">点击这里了解此组件的详细情况</a></div>
	<div class="layui-form-mid layui-word-aux">第一次安装商品索引组件需要重新生成所有索引。<a href="javascript:newTab('生成商品索引','${ctx}/shop/admin/goods-index/input.do')">点击这里去生成所有索引。</a></div>
</div>

	
<script>


$(function(){
	
	$("#uploadBtn").click(function(){
		layui.upload({
		    url: '${ctx}/eop/upload/upload-file.do?ajax=1&subFolder=spec'
		    ,elem: '#uploadBtn' //指定原始元素，默认直接查找class="layui-upload-file"
		    ,method: 'post' //上传接口的http类型
		    ,success: function(res){
		    	img_file.src = res.path;
		    	$("#default_img_url").val(res.path);
		    }
		 });
	}); 

	$(".check").click(function(){
		var $this  = $(this);
		var id =$this.attr("clz");
		$.ajax({
			url:'check-component/exist.do',
			data:'id='+id,
			dataType:"json",
			success:function(json){
				if(json.result==0){
					alert("此组件不存在，请您购买安装后再启用。");
					$this.removeAttr("checked");
					$this.siblings("[value=0]").attr("checked","checked")
				}
			},
			error:function(){
				alert("出现意外错误");
			}
		});
	});
	 		
	<#if system.wap_open?? && system.wap_open=="1">
		$(".wap-setting").show();
	<#else>
		$(".wap-setting").hide();
	</#if>
	$(".wap-opation").click(function(){
	 
		if(this.value==1    ){
			$(".wap-setting").show();
		}else{
			$(".wap-setting").hide();
		}
	});
	
});
</script>
